mui.plusReady(function() {
	mui.post(http('Api/category'), function(data) {
		var html = '';
		for (var i in data) {
			html += '<li cid="' + data[i].cid + '" id="category" class="mui-table-view-cell mui-media mui-col-xs-6">\
						<a href="#">\
							<div class="mui-media-body">' + data[i].ctitle + '</div>\
						</a>\
					</li>';
		}
		$("#box").append(html);
	}, 'json');

	//分类点击
	var articlePage = null;
	$("#category").live('tap', function() {
		var cid = $(this).attr('cid');
		//预加载
		var page = mui.preload({
			url: 'articlelist.html',
			id: 'articlelist.html', //默认使用当前页面的url作为id
			styles: {
				scrollIndicator: 'none'
			}, //窗口参数
			extras: {} //自定义扩展参数
		});
		if (!articlePage) 
		{
			articlePage = plus.webview.getWebviewById('articlelist.html');	
		} 
		//触发详情页面的newsid事件
		mui.fire(articlePage,'newsId',{
			id:cid
		})
		setTimeout(function () {
			plus.webview.show('articlelist.html', 'zoom-fade-out', 300);
		},200)
	})
})